<script setup>
import {Plus} from "@element-plus/icons-vue";
import {ref} from "vue";
import _ from "loadsh"
import useWebsiteStore from "@/store/websiteStore";
import {value} from "loadsh/seq";

const websiteStore = useWebsiteStore();
const keywords = ref("");

const emit = defineEmits(['onAdd'])
const onAdd = () => {
    emit("onAdd")
}


const onSearch = _.debounce(() => {
    websiteStore.setKeywords(keywords.value);
}, 500)

</script>

<template>
    <!--    搜索、查询-->
    <el-row style="padding: 0 20px">
        <el-col :span="3">
            <el-button type="primary" :icon="Plus" @click="onAdd()"/>
        </el-col>
        <el-col :span="9">
            <el-input v-model="keywords" placeholder="请输入" clearable @input="onSearch"/>
        </el-col>

    </el-row>
</template>

<style scoped lang="scss">

</style>
